<?php
/**
 * 项目 todo
 * @desc
 */
class Api_App_signup extends PhalApi_Api {
    public function getRules() {
        return array(
            'add'=>array(
                'name' => array('name' => 'name', 'require' => true, 'explain' => 'POST数据', 'desc' => '项目名称'),
                'email' => array('name' => 'email', 'require' => true, 'explain' => 'POST数据', 'desc' => '邮箱'),
                'pid' => array('name' => 'pid', 'require' => true, 'explain' => 'POST数据', 'desc' => '项目pid'),
                'tel' => array('name' => 'tel', 'require' => true, 'explain' => 'POST数据', 'desc' => '电话'),
            ),
        );
    }

    /**
     * 添加 项目
     * @desc
     */
    public function add(){
        $domain = new Domain_App_Signup();
        $data = array(
            'name' => $this->name,
            'email'=> $this->email,
            'pid'  => $this->pid,
            'tel'  => $this->tel,
        );
        $info = $domain->add($data);
        if($info){
            return array(
                'message' => '添加成功',
            );
        }
    }
}